package me.midday.java.base.knowledge.loadclass;

/**
 * <code>ClassLoader</code>类的<code>loadClass()</code>方法只是加载类而不会初始化
 */


class Tester{
    static {
        System.out.println("Tester 类的静态初始化块");
    }
}

public class ClassLoaderTest {
    public static void main(String[] args) throws ClassNotFoundException {
        ClassLoader cl = ClassLoader.getSystemClassLoader();
        cl.loadClass("me.midday.java.base.knowledge.loadclass.Tester");
        System.out.println("系统加载Tester类");
        Class.forName("me.midday.java.base.knowledge.loadclass.Tester");
    }
}
